package com.cskaoyan.dbutils;

import com.cskaoyan.others.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * 创建日期: 2021/11/25 15:19
 *
 * @author ciggar
 * 无参构造
 */
public class DBUtilsDemo1 {

    public static void main(String[] args) throws SQLException {

        // 无参构造
        QueryRunner queryRunner = new QueryRunner();

        // 执行SQL语句
        int affectedRows = queryRunner.update(DruidUtils.getConnection(),"update account set money = ? where id = ?",1000,1);

        System.out.println("affectedRows:" + affectedRows);
    }
}
